<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
<script>
    let a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
    console.log(
        a.filter(
            item_ => item_ % 2 === 0
        ).map(
            item_ => item_ * item_
        )
    )
</script>
<script>
    let students = ['小明', '小红', '小花'];
    let scores = {
        小明: 59,
        小红: 99,
        小花: 80,
    };
    console.log(
        students.sort((itemA_, itemB_) => {
            return scores[itemB_] - scores[itemA_];
        })
    )
</script>
<script>
    let a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
    console.log(
        a.reduce(
            (reduce_, item_) => {
                if (item_ % 2 === 0) {
                    return reduce_;
                }
                return item_ * item_ + reduce_;
            }, 0
        )
    )
</script>
</body>

</html>